﻿/*
 * Created by SharpDevelop.
 * User: issuser
 * Date: 2010-12-9
 * Time: 14:59
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using NLite.Data.Schema.Provider.Internal;

namespace NLite.Data.Driver
{
	/// <summary>
	/// Description of MySqlDataDriver.
	/// </summary>
	public class MySqlDataDriver:ReflectionBasedDriver
	{
		public MySqlDataDriver():base("MySql.Data.MySqlClient.MySqlConnection,MySql.Data")
		{
            SchemaProvider = new MySqlSchemaProvider();
		}
		
		public override bool UseNamedPrefixInSql
		{
			get { return true; }
		}

		/// <summary></summary>
		public override bool UseNamedPrefixInParameter
		{
			get { return true; }
		}

		/// <summary>
		/// MySql.Data use the <conn>?</conn> to locate parameters in sql.
		/// </summary>
		/// <value><conn>?</conn> is used to locate parameters in sql.</value>
		public override string NamedPrefix
		{
			get { return "@"; }
		}

		/// <summary>
		/// The MySql.Data driver does NOT support more than 1 open IDataReader
		/// with only 1 IDbConnection.
		/// </summary>
		/// <value><see langword="false" /> - it is not supported.</value>
		public override bool SupportsMultipleOpenReaders
		{
			get { return false; }
		}

		/// <summary>
		/// MySql.Data does not support preparing of commands.
		/// </summary>
		/// <value><see langword="false" /> - it is not supported.</value>
		/// <remarks>
		/// With the Gamma MySql.Data provider it is throwing an exception with the 
		/// message "Expected End of data packet" when a select command is prepared.
		/// </remarks>
		public override bool SupportsPreparingCommands
		{
			get { return false; }
		}


    }
}
